{messages}
{if count($aItems)}
<form action="{url link='admin.main.custom-fields'}" method="post">
{/if}
<table cellspacing="0" width="100%" class="forumline">
    <tr>
        <td class="row-header" colspan="6"><span>{language text="Mod_Admin.manage.field"}</span></td>
    </tr>
    {if count($aItems)}
    <tr>
        <th style="width:5%;font-size:9pt;">
            <span>{language text="position"}</span>
        </th>
        <th style="width:40%;text-align:center;font-size:9pt;">
            <span>{language text="title"}</span>
        </th>
        <th style="width:10%;text-align:center;font-size:9pt;">
            <span>{language text="Mod_Admin.type"}</span>
        </th>
        <th style="width:20%;text-align:center;font-size:9pt;">
            <span>{language text="default_option"} / {language text="Mod_Admin.profile.location"}</span>
        </th>
        <th style="width:5%;text-align:center;font-size:9pt;">
            <span>{language text="Mod_Admin.on.signup"}</span>
        </th>
        <th style="width:20%;text-align:center;font-size:9pt;">
            <span>&nbsp;</span>
        </th>
    </tr>
    {/if}
	{foreach from=$aItems item=aItem name=aitems key=iKey}
    <tr>
        <td style="width:5%;font-size:9pt;text-align:center;" class="row1">
            <input type="text" name="pos[{$aItem.custom_field_id}]" style="width:20px;" value="{$aItem.custom_field_pos}" />
        </td>
        <td style="width:40%;font-size:9pt;" class="row1">
            <input type="text" name="title[{$aItem.custom_field_id}]" value="{language translate=$aItem.custom_field_name|escape}" />
        </td>
        <td style="width:10%;font-size:9pt;text-align:center;" class="row1">
		{if $aItem.custom_field_type == '1'}
		{language text="Mod_Admin.textarea"}
		{else}
		{language text="Mod_Admin.drop.down"}
		{/if}
        </td>
        <td style="width:20%;text-align:center;font-size:9pt;" class="row1">
        {if !$aItem.custom_field_type == '1'}
        	{$aItem.custom_field_default_option}
        {else}
            <select name="panel[{$aItem.custom_field_id}]">
            	<option value=""{if $aItem.panel != '1'} selected="true"{/if}>{language text="Mod_Admin.left}</option>
            	<option value="1"{if $aItem.panel == '1'} selected="true"{/if}>{language text="Mod_Admin.right}</option>
            </select>
        {/if}
        </td>
        <td style="width:5%;font-size:9pt;text-align:center;" class="row1">
            <select name="signup[{$aItem.custom_field_id}]">
            	<option value=""{if $aItem.signup != '1'} selected="true"{/if}>{language text="Mod_Admin.no"}</option>
            	<option value="1"{if $aItem.signup == '1'} selected="true"{/if}>{language text="Mod_Admin.yes"}</option>
            </select>
        </td>
        <td style="width:20%;text-align:center;font-size:9pt;" class="row1">
        	{if $aItem.custom_field_type == '0'}
            <a href="{url link='admin.main.custom-fields-option' id=$aItem.custom_field_id}">{language text="edit_380"}</a> |
            {/if}
            <a href="{url link='admin.main.custom-fields' delete=$aItem.custom_field_id}" onclick="return sure('');">{language text="delete_383"}</a> |
            <a href="{url link='admin.language.add-phrase' translate=$aItem.custom_field_name|base64}">{language text='Mod_Language.translate'}</a>
        </td>
    </tr>
	{foreachelse}
    <tr>
        <td colspan="6" align="center"><div class="message_info">{language text="there_are_no_custom_field"}</div></td>
    </tr>
	{/foreach}
	{if count($aItems)}
    <tr>
        <td colspan="6" class="catBottom" style="padding:5px; text-align:center;">
        	<input type="submit" name="act[update]" value="{language text="update"}" />
        	<input type="submit" name="duplicates" value="{language text='Mod_Account.remove_duplicate_entries'}" />
        </td>
    </tr>
	{/if}
</table>
{if count($aItems)}
</form>
{/if}